<!DOCTYPE html>
<html>
<head>
    <title>Device Motion Event Example</title>
    <script type="text/javascript" src="EventUtil.js"></script>
</head>
<body>
    <p>This example only works in Chrome in devices such as Macbooks, Thinkpads, or Android, or on Safari for iOS 4.2+.</p>
    <div id="output"></div>
    <script type="text/javascript">
    EventUtil.addHandler(window, "devicemotion", function(event){
        var output = document.getElementById("output");
        if (event.rotationRate !== null){
            output.innerHTML += "Alpha=" + event.rotationRate.alpha + ", Beta=" + 
                                event.rotationRate.beta + ", Gamma=" + 
                                event.rotationRate.gamma;        
        }
    });
    </script>
</body>
</html>
